import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/merchant'
  },
  {
    path: '/merchant',
    name: 'Merchant',
    component: () => import(/* webpackChunkName: "about" */ '../views/dmallMerchant/index.vue'),
    redirect: '/merchant/deliveryHome',
    children: [
      {
        path: 'deliveryHome',
        component: () => import(/* webpackChunkName: "about" */ '../views/dmallHomeIndex/deliveryHome.vue'),
      },
      {
        path: 'classify',
        component: () => import(/* webpackChunkName: "about" */ '../views/dmallHomeIndex/classify.vue'),
      },
      {
        path: 'cart',
        component: () => import(/* webpackChunkName: "about" */ '../views/dmallHomeIndex/cart.vue'),
      },
      {
        path: 'mine',
        component: () => import(/* webpackChunkName: "about" */ '../views/dmallHomeIndex/mine.vue'),
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
